package cc.catface.app_kotlin_demo

class Start {


    fun main(args: String) {

    }


    fun testing() {
        println(parseInt(""))
        println(parseInt("123"))
        //println(parseInt("12qw"))


        val y = null
        //val x:String = y as String
        val x: String? = y as String?
        println("x:$x, y:$y")


//        val z: String? = null
//        println("z's length:${z!!.length}")
    }


    // if else即?:
    private fun parseInt(str: String): Int? = if (str.isEmpty()) null else str.toInt()


    private fun line() = println("\n++++++++++++++++++++++++++++++++++\n")


}
